package com.xiaoai.controller;

import com.xiaoai.utils.LocalUtil;
import org.junit.Test;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MyController {
    
    @RequestMapping("/login")
    public String login() {
        return "login";
    }

    @ResponseBody
    @GetMapping("/getmsg")
    public String language() {
        String message = LocalUtil.get("login.password");  //调用
        return message;
    }

    @Test
    public void te(){
        LocalUtil.get("login.password");
    }

    @GetMapping("/i18n")
    public String i18(Model model,String lang) {
        Model model1 = model.addAttribute("name", LocalUtil.get("name"));
        return "i18n";
    }
    
}